package hk.linkcredit.walletservice.wallet.service;

import hk.linkcredit.walletservice.rocketmq.WalletProducer;
import hk.linkcredit.walletservice.wallet.domain.vo.WalletAccountMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Author: jamnsin
 * @Date: 2022/8/5 17:53
 */
@Component
public class AsyncService {

    @Autowired
    WalletProducer walletProducer;

    @Async("threadPoolExecutor")
    public void sendWalletAccountAmountMessage(WalletAccountMsg walletAccountMsg) {
        walletProducer.sendWalletAccountAmountMessage(walletAccountMsg.getChangeType(), walletAccountMsg);
    }

}
